import Home from "../page/home";
import Login from "../page/login";
import { Navigate, useRoutes } from "react-router-dom";
const routers = [
  // 访问/时重定向到/home
  {
    path: "/",
    element: <Navigate to="/home" />,
  },
  {
    path: "/home",
    element: <Home />,
  },
  {
    path: "/login",
    element: <Login />,
  },
];
const Router = () => {
  const routes = useRoutes(routers);
  return routes;
};
export { Router };
